package classfile

type LineNumberTableAttribute struct {
	lineNumberTable []*LineNumberTableEntry
}

type LineNumberTableEntry struct {
	startPc uint16
	lineNumber uint16
}

func (self *LineNumberTableAttribute)ReadInfo(reader *ClassReader) {
	length := reader.ReadUint16()
	self.lineNumberTable = make([]*LineNumberTableEntry, length)
	for i := range self.lineNumberTable {
		self.lineNumberTable[i] = newNumberTableEntry(reader)
	}
}

func newNumberTableEntry(reader *ClassReader) *LineNumberTableEntry {
	return &LineNumberTableEntry{
		startPc: reader.ReadUint16(),
		lineNumber: reader.ReadUint16(),
	}
}